package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * StoreRestock entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_STORE_RESTOCK", schema = "HCD_DEV")
public class StoreRestock extends Entity implements java.io.Serializable {

	// Fields

	private Long restockId;
	private Store store;
	private String code;
	private String supplier;
	private Boolean isChecked;
	private String checker;
	private Long checkTime;
	private String adder;
	private Long addTime;
	private Set<StoreRestockGoods> storeRestockGoodses = new HashSet<StoreRestockGoods>(0);

	// Constructors

	/** default constructor */
	public StoreRestock() {
	}

	/** minimal constructor */
	public StoreRestock(Store store, String code, Boolean isChecked, String adder, Long addTime) {
		this.store = store;
		this.code = code;
		this.isChecked = isChecked;
		this.adder = adder;
		this.addTime = addTime;
	}

	/** full constructor */
	public StoreRestock(Store store, String code, String supplier, Boolean isChecked,
			String checker, Long checkTime, String adder, Long addTime,
			Set<StoreRestockGoods> storeRestockGoodses) {
		this.store = store;
		this.code = code;
		this.supplier = supplier;
		this.isChecked = isChecked;
		this.checker = checker;
		this.checkTime = checkTime;
		this.adder = adder;
		this.addTime = addTime;
		this.storeRestockGoodses = storeRestockGoodses;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_STORE_RESTOCK")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "RESTOCK_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getRestockId() {
		return this.restockId;
	}

	public void setRestockId(Long restockId) {
		this.restockId = restockId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_ID", nullable = false)
	public Store getStore() {
		return this.store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@Column(name = "CODE", nullable = false, length = 50)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "SUPPLIER", length = 100)
	public String getSupplier() {
		return this.supplier;
	}

	public void setSupplier(String supplier) {
		this.supplier = supplier;
	}

	@Column(name = "IS_CHECKED", nullable = false, precision = 1, scale = 0)
	public Boolean getIsChecked() {
		return this.isChecked;
	}

	public void setIsChecked(Boolean isChecked) {
		this.isChecked = isChecked;
	}

	@Column(name = "CHECKER", length = 100)
	public String getChecker() {
		return this.checker;
	}

	public void setChecker(String checker) {
		this.checker = checker;
	}

	@Column(name = "CHECK_TIME", precision = 15, scale = 0)
	public Long getCheckTime() {
		return this.checkTime;
	}

	public void setCheckTime(Long checkTime) {
		this.checkTime = checkTime;
	}

	@Column(name = "ADDER", nullable = false, length = 100)
	public String getAdder() {
		return this.adder;
	}

	public void setAdder(String adder) {
		this.adder = adder;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "storeRestock")
	public Set<StoreRestockGoods> getStoreRestockGoodses() {
		return this.storeRestockGoodses;
	}

	public void setStoreRestockGoodses(Set<StoreRestockGoods> storeRestockGoodses) {
		this.storeRestockGoodses = storeRestockGoodses;
	}

}